﻿@{
    Layout = null;
}
@{

    List<LeEdu.MODEL.ZhangJie> lst = ViewBag.zhang;

}

<!DOCTYPE html>

<html>
<!-- 网页头部分布视图 -->
@Html.Partial("~/Views/Shared/HouTai_Header.cshtml")
<body>
    <!--视频上传js引用-->
    <link rel="stylesheet" href="~/uploadflie/css/plupload.queue.css" type="text/css" media="screen" />
    <script type="text/javascript" src="~/uploadflie/jquery.min.js"></script>
    <script type="text/javascript" src="~/uploadflie/jquery.plupload.queue.min.js"></script>
    <script type="text/javascript" src="~/uploadflie/plupload.min.js"></script>
    <script type="text/javascript" src="~/uploadflie/plupload.flash.min.js"></script>

    <!--视频上传js代码-->
    <script>
        $(function () {
            // 初始化Flash上传插件
            $("#flash_uploader").pluploadQueue({
                runtimes: 'html5,flash,silverlight,html4', 	//使用Flash插件
                url: '@Url.Content("/Course/Upload")', 	//服务器端响应页面
                max_file_size: '2048mb', //最大文件限制
                chunk_size: '10mb', 	//一次上传数据大小
                unique_names: true, 	//是否自动生成唯一名称
                filters: [				//文件类型限制，需要对上传文件进行限制可以使用
                    { title: "视频文件", extensions: "mp4,webm,ogg,docx,txt,ppt,mp3" }
                ],

                // 缩放图片
                //resize: { width: 180, height: 150, quality: 80 },

                // SWF文件位置
                flash_swf_url: '@Url.Content("~/upload/plupload.flash.swf")',

                init: {
                    FileUploaded: function (up, file, info) {
                        //一个文件上传成功
                        //alert("上传成功！");
                    },

                    Error: function (up, args) {
                        //发生错误
                        if (args.file) {
                            alert('[error] File:' + args.file);
                        } else {
                            alert('[error]' + args);
                        }
                    }
                }
            });
        });
        $(function () {
            $("#myModal").on("hide.bs.modal", function () {
                //$(this).removeData("bs.modal");
                $("#StuCount").val = '';
                $("#flash_uploader").val = "";
            });
        })
    </script>

    <!-- 网页导航菜单分布视图 -->
    @Html.Partial("~/Views/Shared/HouTai_DaoHang.cshtml")
    <div class="container">
        <div class="row">
            <!-- 网页左侧菜单分布视图 -->
            @Html.Partial("~/Views/Shared/CouseCreateManage_Menu_Left.cshtml")


            <div class="col-md-10">

                <div class="panel panel-default panel-col lesson-manage-panel">
                    <div style="position: relative; top: 0px; bottom: 3px; left: 0px; width: auto;" class="panel-heading">
                        <div class="pull-right">
                            <button class="btn btn-info btn-sm" id="lesson-create-btn" data-toggle="modal" data-target="#modal" data-backdrop="static" data-keyboard="false" data-url="/course/86/manage/lesson/create"><i class="glyphicon glyphicon-plus"></i> 课时</button>
                            <button class="btn btn-info btn-sm" id="lesson-create-btn" data-toggle="modal" data-target="#Sodal" data-backdrop="static" data-keyboard="false" data-url="/course/86/manage/lesson/create"><i class="glyphicon glyphicon-plus"></i> 试题</button>

                        </div>
                        课时管理
                    </div>

                    <div class="panel-body">
                        <ul class="lesson-list sortable-list" id="course-item-list">


                            @*课时*@
                            @foreach (var item in ViewBag.lsth as List<LeEdu.MODEL.Hour>)
                            {
                                <li class="item-lesson clearfix" id="lesson-115" style="word-break: break-all;">
                                    <div class="item-line"></div>
                                    <div class="item-content">

                                        <i class="fa fa-file-video-o text-success"></i>

                                        课时 <span class="number">@item.HourId</span>：

                                        @item.HTitle

                                        <span class="text-muted">@item.HVideoTime</span>


                                    </div>
                                    <div class="item-actions">
                                        <a title="" data-original-title="" class="btn btn-link" data-toggle="modal" data-target="#modal" data-backdrop="static" data-keyboard="false" data-url="/course/120/manage/lesson/115/edit"><span class="es-icon es-icon-edit prs"></span>编辑</a>
                                        <a title="" data-original-title="" class="btn btn-link" href="/course/120/learn?preview=1#lesson/115" target="_blank"><span class="es-icon es-icon-visibility prs"></span>预览</a>                                        
                                        
                                        <div class="dropdown">
                                        </div>
                                    </div>
                                </li>
                            }



                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div id="login-modal" class="modal" data-url="/login/ajax"></div>
    <!--模态框上传-->
    <div aria-hidden="true" style="display: none;" id="modal" class="modal">
        <div class="modal-dialog  modal-lg">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                    <h4 class="modal-title"> 添加课时</h4>
                </div>
                <form action="/Course/AddCourseHour" method="post">
                    <div class="modal-body">
                        <!--类型-->
                        <div class="form-group">
                            <div class="col-md-2 control-label"><label>类型</label></div>
                            <div class="col-md-10 controls">

                                <label>
                                    <input id="Radio1" type="radio" name="HType" value="0" />&nbsp;&nbsp;视频&nbsp;&nbsp;&nbsp;&nbsp;
                                    <input id="Radio1" type="radio" name="HType" value="1" />&nbsp;&nbsp;音频&nbsp;&nbsp;&nbsp;&nbsp;
                                    <input id="Radio1" type="radio" name="HType" value="2" />&nbsp;&nbsp;word文档&nbsp;&nbsp;&nbsp;&nbsp;
                                    <input id="Radio1" type="radio" name="HType" value="3" />&nbsp;&nbsp;txt文档&nbsp;&nbsp;&nbsp;&nbsp;
                                    <input id="Radio1" type="radio" name="HType" value="4" />&nbsp;&nbsp;ppt文档
                                </label>
                            </div>
                        </div>
                        <!--类型-->
                        <!--标题-->
                        <div class="form-group " style="padding-top:20px">
                            <div class="col-md-2 control-label"><label for="lesson-title-field">标题</label></div>
                            <div class="col-md-10 controls">


                                <input data-explain="" data-widget-cid="widget-21" id="lesson-title-field" class="form-control" name="HTitle" type="text">


                                <div class="help-block" style="display:none;"></div>
                            </div>
                        </div>

                        <!--标题-->
                        <!--简介-->
                        <div class="form-group " style="padding-top:30px">
                            <div class="col-md-2 control-label"><label for="lesson-summary-field">简介</label></div>
                            <div class="col-md-10 controls">
                                <textarea class="form-control" id="lesson-summary-field" name="HAbout"></textarea>
                            </div>
                        </div>
                        <!--简介-->
                        <!--视频-->
                        <div class="form-group">
                            <div class="col-md-2 control-label" style="margin-top:10px"><label for="lesson-summary-field">视频</label></div>
                            <div class="col-md-10 controls" style="margin-top:10px">
                                <ul class="nav nav-pills nav-pills-sm mbs file-chooser-tabs ">
                                    <li class="active"><a href="#video-chooser-upload-pane" data-toggle="tab">上传视频</a></li>
                                    <li>
                                        <a href="#video-chooser-course-file" data-toggle="tab">
                                            从课程文件中选择
                                        </a>
                                    </li>
                                    <li><a href="#video-chooser-import-pane" data-toggle="tab">导入网络视频</a></li>
                                </ul>

                            </div>
                        </div>
                        <div class="tab-content col-md-10 col-md-offset-2">

                            @*上传视频*@
                            <div class="tab-pane active" id="video-chooser-upload-pane">
                                <div class="file-chooser-uploader">
                                    <div class="file-chooser-uploader-label">
                                        选择你要上传的视频文件：
                                    </div>

                                    <div class="file-chooser-uploader-control">
                                        <div id="flash_uploader" style="width:100%;">您没有安装Flash！</div>
                                    </div>
                                    <div data-widget-cid="widget-3" class="progress" id="video-chooser-progress" style="display:none;">
                                        <div class="progress-bar" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%;">
                                        </div>
                                    </div>
                                </div>
                                <div class="modal-footer">
                                    <button type="button" class="btn btn-primary" data-dismiss="modal" id="cancel-btn">取消</button>
                                    <button id="course-lesson-btn" data-submiting-text="正在提交" type="submit" class="btn btn-primary" data-toggle="form-submit">添加</button>
                                </div>
                            </div>
                            <!--从课程文件中选择-->
                            <div class="tab-pane " id="video-chooser-course-file">
                                <div class="file-browser" data-widget-cid="widget-1" id="file-browser-video" data-role="course-file-browser" data-url="/uploadfile/browsers?targetType=courselesson&amp;targetId=116&amp;type=video" data-empty="暂无视频文件，请先上传。">
                                    <div class="empty" style="width:100%; ">
                                        <table class="table table-striped table-hover" id="course-lesson-table">
                                            <thead>
                                                <tr>
                                                    <th><input data-role="batch-select" type="checkbox" name="xz"></th>
                                                    <th>文件名</th>
                                                    <th>类型</th>
                                                    <th>大小</th>
                                                    <th>最后更新</th>
                                                </tr>
                                            </thead>
                                            @foreach (var item in ViewBag.list as List<LeEdu.MODEL.Files>)
                                            {
                                            <tbody>
                                                <tr>
                                                    <td>
                                                        <input data-role="batch-select" type="checkbox" name="fid" value="@item.FilesId">
                                                    </td>
                                                    <td>
                                                        @item.FilesName
                                                    </td>
                                                    <td>
                                                        @(item.FType == 0 ? "视频" : item.FType == 1 ? "音频" : item.FType == 2 ? "word文档" : item.FType == 3 ? "txt文档" : "ppt文档")
                                                    </td>
                                                    <td>
                                                        @item.FSize MB
                                                    </td>
                                                    <td>
                                                        @item.FTime
                                                    </td>
                                                </tr>
                                            </tbody>
                                            }
                                        </table>
                                    </div>
                                </div>
                                <div class="modal-footer">
                                    <button type="button" class="btn btn-primary" data-dismiss="modal" id="cancel-btn">取消</button>
                                    <button id="course-lesson-btn" data-submiting-text="正在提交" type="submit" class="btn btn-primary" data-toggle="form-submit">添加</button>
                                </div>
                            </div>

                            @*导入网络视频*@
                            @*<div class="tab-pane" id="video-chooser-import-pane">
                                    <div class="input-group">
                                        <input class="form-control" placeholder="支持优酷、土豆、腾讯、网易公开课的视频页面地址导入" data-role="import-url" type="text">
                                        <span class="input-group-btn">
                                            <button type="button" class="btn btn-default" data-role="import" data-url="/course/117/manage/media/import" data-loading-text="正在导入，请稍等">导入</button>
                                        </span>
                                    </div>
                                    <div class="modal-footer">
                                        <button type="button" class="btn btn-primary" data-dismiss="modal" id="cancel-btn">取消</button>
                                        <button id="course-lesson-btn" data-submiting-text="正在提交" type="submit" class="btn btn-primary" data-toggle="form-submit">添加</button>
                                    </div>
                                </div>*@

                        </div>

                    </div>

                </form>
            </div>
        </div>
    </div>

    <!--模态框上传试题-->
    <div aria-hidden="true" style="display: none;" id="Sodal" class="modal">
        <div class="modal-dialog  modal-lg">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                    <h4 class="modal-title">  添加试卷课时</h4>
                </div>
                <form data-widget-cid="widget-0" novalidate="novalidate" id="course-lesson-form" class="form-horizontal lesson-form" method="post" data-parentid="" action="/Course/HourManageAdd">
                    <div class="modal-body">


                        <div class="form-group">
                            <div class="col-md-2 control-label"><label for="lesson-mediaId-field">试卷</label></div>
                            <div class="col-md-9 controls">
                                @{
                                    
                                }
                                
                                <select data-explain="如果找不到试卷，请先确定该试卷已经发布" data-widget-cid="widget-6" id="lesson-mediaId-field" class="form-control" name="ExamID" data-url="/testpaper/real-time/check" data-get-testpaper-items="/course/157/manage/testpaper/items_get">
                                    @foreach (var item in ViewBag.exam as List<LeEdu.MODEL.Exam>)
                                    {
                                    <option value="@item.ExamID">@item.ExamName</option>
                                    }
                                </select>
                                <div class="help-block">如果找不到试卷，请先确定该试卷已经发布</div>
                            </div>
                        </div>

                        <div class="form-group" id="questionItemShowDiv" style="display:none;">
                            <div class="col-md-2 control-label"></div>
                            <div class="col-md-9 controls" id="questionItemShowTable">

                            </div>
                        </div>

                        <div class="form-group">
                            <div class="col-md-2 control-label"><label for="lesson-title-field">标题</label></div>
                            <div class="col-md-9 controls">
                                <input data-explain="" data-widget-cid="widget-4" id="lesson-title-field" class="form-control" name="HTitle" value="" type="text">
                                <div class="help-block" style="display:none;"></div>
                            </div>
                        </div>


                        <div class="form-group">
                            <div class="col-md-2 control-label"><label for="lesson-suggest-hour-field">学习时长</label></div>
                            <div class="col-md-9 controls">
                                建议
                                <input data-explain="（如未设置，则默认完成时长为：客观题每题5分钟、主观题每题30分钟。合计取整）
          " data-widget-cid="widget-5" id="lesson-suggest-hour-field" class="form-control width-input width-input-small" name="HStudyTime" value="0.0" type="text"> 小时
                                <div class="help-block">
                                    （如未设置，则默认完成时长为：客观题每题5分钟、主观题每题30分钟。合计取整）
                                </div>
                            </div>
                        </div>

                        <input name="_csrf_token" value="2e1f86d1f1eede415e0fd8878d4c600d360345b8" type="hidden">

                        <script>app.load('course-manage/lesson-testpaper-modal')</script>


                    </div>

                    <div class="modal-footer">
                        <button type="button" class="btn btn-link" data-dismiss="modal">取消</button>
                        <button id="course-testpaper-btn" data-submiting-text="正在提交" type="submit" class="btn btn-primary" data-toggle="form-submit" data-target="#course-lesson-form">保存</button>
                    </div>
                </form>
            </div>

        </div>

    </div>


    <script>
        var app = {};
        app.debug = false;
        app.version = '6.9.3';
        app.httpHost = 'http://www.zhishile.com';
        app.basePath = '';
        app.theme = 'jianmo';
        app.themeGlobalScript = 'theme/global-script';
        app.jsPaths = { "common": "common", "theme": "\/themes\/jianmo\/js", "customwebbundle": "\/bundles\/customweb\/js", "customadminbundle": "\/bundles\/customadmin\/js", "topxiawebbundle": "\/bundles\/topxiaweb\/js", "topxiaadminbundle": "\/bundles\/topxiaadmin\/js", "classroombundle": "\/bundles\/classroom\/js" };
        app.crontab = '/common/crontab';

        var CKEDITOR_BASEPATH = app.basePath + '/assets/libs/ckeditor/4.6.7/';
        app.config = { "api": { "weibo": { "key": "" }, "qq": { "key": "" }, "douban": { "key": "" }, "renren": { "key": "" } }, "cloud": { "video_player": "http:\/\/cdn.staticfile.org\/GrindPlayerCN\/1.0.2\/GrindPlayer.swf", "video_player_watermark_plugin": "http:\/\/cdn.staticfile.org\/GrindPlayerCN\/1.0.2\/Watermake-1.0.3.swf", "video_player_fingerprint_plugin": "http:\/\/cdn.staticfile.org\/GrindPlayerCN\/1.0.2\/Fingerprint-1.0.1.swf" }, "loading_img_path": "\/assets\/img\/default\/loading.gif?6.9.3" };
        app.arguments = {};
        app.controller = 'user/list';

        app.scripts = null;

        app.uploadUrl = '/file/upload';
        app.imgCropUrl = '/file/img/crop';
        app.lessonCopyEnabled = '0';
        app.mainScript = '/bundles/topxiaadmin/js/admin-app.js?6.9.3';
    </script>
    <script src="/Content/js/sea.js?6.9.3"></script>
    <script src="/Content/js/seajs-style.js?6.9.3"></script>
    <script src="/Content/js/seajs-global-config.js?6.9.3"></script>
    <script>
        seajs.use(app.mainScript);
    </script>  <div id="modal" class="modal"></div>
    @*<div class="fixed-bar">
            <a href="/admin/feedback" target='_blank' class="icon-question-text feedback">
                <i class="es-icon es-icon-help"></i>
                <span>产品<br />反馈</span>
            </a>
        </div>*@
</body>

</html>